﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Core;
using System.Collections;

namespace Yuanlin.Business
{
    public class ProductRequest : TEntityRequest<Product>
    {
        public ProductRequest()
        {
            int? entityId = GetParameterValue<int?>(YuanlinParameterName.ProductId);
            if (entityId.HasValue)
            {
                EntityId = entityId.Value;
            }
        }
    }
    public class ProductListRequest : TEntityListRequest<Product>
    {
        private int? categoryId = GetParameterValue<int?>(YuanlinParameterName.CategoryId);
        private int? keBieId = GetParameterValue<int?>(YuanlinParameterName.KeBieId);
        private string title = GetParameterValue<string>(YuanlinParameterName.Title);
        private string equalTitle = GetParameterValue<string>(YuanlinParameterName.EqualTitle);
        private string queryValue = null;

        public int? CategoryId
        {
            get
            {
                return categoryId;
            }
            set
            {
                categoryId = value;
            }
        }
        public int? MiaomuCategoryId
        {
            get
            {
                return keBieId;
            }
            set
            {
                keBieId = value;
            }
        }
        public string Title
        {
            get
            {
                if (!string.IsNullOrEmpty(title))
                {
                    return string.Format("%{0}%", title);
                }
                return "";
            }
            set
            {
                title = value;
            }
        }
        public string EqualTitle
        {
            get
            {
                return equalTitle;
            }
            set
            {
                equalTitle = value;
            }
        }
        public string QueryValue
        {
            get
            {
                if (!string.IsNullOrEmpty(queryValue))
                {
                    return string.Format("%、{0}%", queryValue);
                }
                return "";
            }
            set
            {
                queryValue = value;
            }
        }
    }
    public class ProductReply : EntityReply
    {
    }
}

